package com.forest.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author Administrator
 */
@Configuration
@ConfigurationProperties("config.encryption")
public class EncryptionProperties {

    /**
     * 加密密匙.
     */
    private String secretKey = "";

    /** app 加密算法类型 默认 SM4 */
    private String encryptionAlgorithm = "SM4";

    /**
     * 加密向量.
     */
    private String iv;

    /**
     * 是否使用固定向量.
     */
    private Boolean enableFixedIv = false;

    /**
     * 是否使用国密提供者.
     *
     */
    private Boolean useBouncyCastle = true;

    /**
     * 加密失败，是否抛出异常.
     */
    private Boolean throwException = false;

    public String getSecretKey() {
        return secretKey;
    }
    /**
     * 加密密匙.
     */
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getEncryptionAlgorithm() {
        return encryptionAlgorithm;
    }

    public void setEncryptionAlgorithm(String encryptionAlgorithm) {
        this.encryptionAlgorithm = encryptionAlgorithm;
    }

    public String getIv() {
        return iv;
    }

    public void setIv(String iv) {
        this.iv = iv;
    }

    public Boolean getEnableFixedIv() {
        return enableFixedIv;
    }

    public void setEnableFixedIv(Boolean enableFixedIv) {
        this.enableFixedIv = enableFixedIv;
    }

    public Boolean getUseBouncyCastle() {
        return useBouncyCastle;
    }

    public void setUseBouncyCastle(Boolean useBouncyCastle) {
        this.useBouncyCastle = useBouncyCastle;
    }

    public Boolean getThrowException() {
        return throwException;
    }

    public void setThrowException(Boolean throwException) {
        this.throwException = throwException;
    }
}
